/*
 Navicat Premium Data Transfer

 Source Server         : putian3307
 Source Server Type    : MySQL
 Source Server Version : 50529 (5.5.29)
 Source Host           : localhost:3307
 Source Schema         : putian

 Target Server Type    : MySQL
 Target Server Version : 50529 (5.5.29)
 File Encoding         : 65001

 Date: 01/11/2024 11:03:57
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for fa_gdshop_address
-- ----------------------------
DROP TABLE IF EXISTS `fa_gdshop_address`;
CREATE TABLE `fa_gdshop_address`  (
  `id` int(11) NOT NULL DEFAULT 0 COMMENT '地址ID，唯一标识',
  `user_id` int(11) NOT NULL COMMENT '用户ID，关联用户表',
  `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '收货人姓名',
  `phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '收货人电话',
  `province_id` int(11) NOT NULL COMMENT '省份ID',
  `city_id` int(11) NOT NULL COMMENT '城市ID',
  `area_id` int(11) NOT NULL COMMENT '区域/区县ID',
  `site` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '收货详细地址（不含省、市、区）',
  `tag` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '地址标签（如：默认、家、公司等）',
  `is_default` tinyint(1) NULL DEFAULT 0 COMMENT '是否为默认地址，0：否，1：是',
  `createtime` bigint(20) NULL DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(20) NULL DEFAULT NULL COMMENT '更新时间'
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci;

-- ----------------------------
-- Records of fa_gdshop_address
-- ----------------------------
BEGIN;
INSERT INTO `fa_gdshop_address` (`id`, `user_id`, `name`, `phone`, `province_id`, `city_id`, `area_id`, `site`, `tag`, `is_default`, `createtime`, `updatetime`) VALUES (1, 1, '张三', '13812345678', 933, 1015, 1022, '具体地址 1', '家', 0, 1729495526, 1729495526), (2, 1, '李四', '13987654321', 1709, 1822, 1823, '具体地址 2', '公司', 0, 1729495526, 1729495526), (3, 1, '王五', '13798765432', 1168, 1190, 1195, '湄洲湾职业技术学院-仙游校区', '学校', 1, 1729495526, 1729495526);
COMMIT;

-- ----------------------------
-- Table structure for fa_gdshop_banner
-- ----------------------------
DROP TABLE IF EXISTS `fa_gdshop_banner`;
CREATE TABLE `fa_gdshop_banner`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `banner_image` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '图片地址',
  `title` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '图片说明',
  `weigh` int(11) NULL DEFAULT 0 COMMENT '权重',
  `target_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '广告详情URL',
  `status` tinyint(1) NULL DEFAULT 1 COMMENT '状态 (1: 激活, 0: 禁用)',
  `createtime` bigint(20) NULL DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '广告横幅表';

-- ----------------------------
-- Records of fa_gdshop_banner
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for fa_gdshop_cart
-- ----------------------------
DROP TABLE IF EXISTS `fa_gdshop_cart`;
CREATE TABLE `fa_gdshop_cart`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  `user_id` int(10) UNSIGNED NOT NULL COMMENT '用户 ID',
  `sku_id` int(10) UNSIGNED NOT NULL COMMENT '商品 SKU ID',
  `quantity` int(11) NOT NULL COMMENT '数量',
  `is_selected` tinyint(1) NOT NULL COMMENT '是否选中，0 表示未选中，1 表示选中',
  `add_time` bigint(16) NOT NULL COMMENT '加入时间',
  `createtime` bigint(16) NULL DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) NULL DEFAULT NULL COMMENT '修改时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '购物车表';

-- ----------------------------
-- Records of fa_gdshop_cart
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for fa_gdshop_category
-- ----------------------------
DROP TABLE IF EXISTS `fa_gdshop_category`;
CREATE TABLE `fa_gdshop_category`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `category_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '分类名称',
  `category_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '分类类型',
  `parent_id` int(10) UNSIGNED NULL DEFAULT NULL COMMENT '父分类ID',
  `avatar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '图标',
  `memo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '描述',
  `createtime` bigint(20) UNSIGNED NULL DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(20) UNSIGNED NULL DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `idx_category_name`(`category_name`) USING BTREE,
  INDEX `parent_id`(`parent_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '回收分类表';

-- ----------------------------
-- Records of fa_gdshop_category
-- ----------------------------
BEGIN;
INSERT INTO `fa_gdshop_category` (`id`, `category_name`, `category_type`, `parent_id`, `avatar`, `memo`, `createtime`, `updatetime`) VALUES (1, '电子产品', '电子产品2', NULL, NULL, NULL, NULL, NULL), (2, '服装', '服装2', NULL, NULL, NULL, NULL, NULL), (3, '家居', '家居2', NULL, NULL, NULL, NULL, NULL), (4, '鞋', '鞋2', NULL, NULL, NULL, NULL, NULL), (5, '电子产品2', '电子产品', NULL, NULL, NULL, NULL, NULL);
COMMIT;

-- ----------------------------
-- Table structure for fa_gdshop_coupon
-- ----------------------------
DROP TABLE IF EXISTS `fa_gdshop_coupon`;
CREATE TABLE `fa_gdshop_coupon`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '优惠券描述',
  `coupon_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '优惠券类型',
  `category_ids` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '品类列表，用逗号分割，为NULL或空字符串时表示全品类',
  `start_date` bigint(20) NOT NULL COMMENT '生效日期',
  `end_date` bigint(20) NOT NULL COMMENT '失效日期',
  `is_giftable` tinyint(1) NOT NULL COMMENT '是否可赠送，0 表示不可赠送，1 表示可赠送',
  `threshold` decimal(10, 2) NOT NULL COMMENT '阈值金额',
  `face_value` decimal(10, 2) NOT NULL COMMENT '面值',
  `createtime` bigint(20) NULL DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(20) NULL DEFAULT NULL COMMENT '更新时间',
  `deletetime` bigint(20) NULL DEFAULT NULL COMMENT '删除时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 11 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '优惠券表';

-- ----------------------------
-- Records of fa_gdshop_coupon
-- ----------------------------
BEGIN;
INSERT INTO `fa_gdshop_coupon` (`id`, `description`, `coupon_type`, `category_ids`, `start_date`, `end_date`, `is_giftable`, `threshold`, `face_value`, `createtime`, `updatetime`, `deletetime`) VALUES (1, '满 100 减 10，全品类可用', '通用券', '', 1730162498, 1730158898, 0, 100.00, 10.00, NULL, NULL, NULL), (2, '满 200 减 20，仅限电子产品', '限品类券', '1', 1730248898, 1730767298, 1, 200.00, 20.00, NULL, NULL, NULL), (3, '全场 8 折券', '折扣券', '', 1730248898, 1731458498, 0, 0.00, 0.00, NULL, NULL, NULL), (4, '满 300 减 30，服装类可用', '限品类券', '2', 1730248898, 1731026498, 1, 300.00, 30.00, NULL, NULL, NULL), (5, '满 500 减 50，全品类可用', '通用券', '', 1730290508, 1730304108, 1, 500.00, 50.00, NULL, NULL, NULL), (6, '满 800 减 80，家居用品可用', '限品类券', '3', 1730248898, 1731199298, 0, 800.00, 80.00, NULL, NULL, NULL), (7, '满 1500 减 150，电子产品和家电可用', '限品类券', '1,3', 1730248898, 1731717698, 1, 1500.00, 150.00, NULL, NULL, NULL), (8, '满 1000 减 100，全品类可用', '通用券', '', 1730076098, 1730076098, 0, 1000.00, 100.00, NULL, NULL, NULL), (9, '满 400 减 40，鞋类可用', '限品类券', '4', 1730248898, 1731372098, 1, 400.00, 40.00, NULL, NULL, NULL), (10, '满 600 减 60，全品类可用', '通用券', '', 1730248898, 1732322498, 0, 600.00, 60.00, NULL, NULL, NULL);
COMMIT;

-- ----------------------------
-- Table structure for fa_gdshop_demo
-- ----------------------------
DROP TABLE IF EXISTS `fa_gdshop_demo`;
CREATE TABLE `fa_gdshop_demo`  (
  `id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT 'ID',
  `category_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '分类名称',
  `category_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '分类类型',
  `parent_id` int(10) UNSIGNED NULL DEFAULT NULL COMMENT '父分类ID',
  `avatar` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `memo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '描述',
  `createtime` bigint(16) UNSIGNED NULL DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) UNSIGNED NULL DEFAULT NULL COMMENT '更新时间'
) ENGINE = MyISAM CHARACTER SET = utf8 COLLATE = utf8_general_ci;

-- ----------------------------
-- Records of fa_gdshop_demo
-- ----------------------------
BEGIN;
INSERT INTO `fa_gdshop_demo` (`id`, `category_name`, `category_type`, `parent_id`, `avatar`, `memo`, `createtime`, `updatetime`) VALUES (1, '纸皮类', 'paper', NULL, '', NULL, NULL, NULL), (2, '衣物&其它', 'clothing_others', NULL, '', NULL, NULL, NULL), (3, '金属类', 'metal', NULL, '', NULL, NULL, NULL), (4, '塑料类', 'plastic', NULL, '', NULL, NULL, NULL), (5, '报纸', 'paper', 1, '', NULL, NULL, NULL), (6, '废纸', 'paper', 1, '', NULL, NULL, NULL), (7, '纸箱等', 'paper', 1, '', NULL, NULL, NULL), (8, '衣服', 'clothing_others', 2, '', NULL, NULL, NULL), (9, '玻璃', 'clothing_others', 2, '', NULL, NULL, NULL), (10, '家具', 'clothing_others', 2, '', NULL, NULL, NULL), (11, '家电等', 'clothing_others', 2, '', NULL, NULL, NULL), (12, '铁', 'metal', 3, '', NULL, NULL, NULL), (13, '铜', 'metal', 3, '', NULL, NULL, NULL), (14, '铝等', 'metal', 3, '', NULL, NULL, NULL), (15, '各类塑料制品', 'plastic', 4, '', NULL, NULL, NULL);
COMMIT;

-- ----------------------------
-- Table structure for fa_gdshop_demo2
-- ----------------------------
DROP TABLE IF EXISTS `fa_gdshop_demo2`;
CREATE TABLE `fa_gdshop_demo2`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `category_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '分类名称',
  `code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '分类代码',
  `category_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '分类类型',
  `parent_id` int(10) UNSIGNED NULL DEFAULT NULL COMMENT '父分类ID',
  `price_unit` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '单位',
  `avatar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '图标',
  `memo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '描述',
  `createtime` bigint(16) UNSIGNED NULL DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) UNSIGNED NULL DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `parent_id`(`parent_id`) USING BTREE,
  CONSTRAINT `fa_gdshop_demo2_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `fa_gdshop_demo2` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 16 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '回收分类表';

-- ----------------------------
-- Records of fa_gdshop_demo2
-- ----------------------------
BEGIN;
INSERT INTO `fa_gdshop_demo2` (`id`, `category_name`, `code`, `category_type`, `parent_id`, `price_unit`, `avatar`, `memo`, `createtime`, `updatetime`) VALUES (1, '纸皮类', NULL, 'paper', NULL, NULL, '', NULL, NULL, NULL), (2, '衣物&其它', NULL, 'clothing_others', NULL, NULL, '', NULL, NULL, NULL), (3, '金属类', NULL, 'metal', NULL, NULL, '', NULL, NULL, NULL), (4, '塑料类', NULL, 'plastic', NULL, NULL, '', NULL, NULL, NULL), (5, '报纸', NULL, 'paper', 1, '元/公斤', '', NULL, NULL, NULL), (6, '废纸', NULL, 'paper', 1, '元/公斤', '', NULL, NULL, NULL), (7, '纸箱等', NULL, 'paper', 1, '元/公斤', '', NULL, NULL, NULL), (8, '衣服', NULL, 'clothing_others', 2, '元/袋', '', NULL, NULL, NULL), (9, '玻璃', NULL, 'clothing_others', 2, NULL, '', NULL, NULL, NULL), (10, '家具', NULL, 'clothing_others', 2, NULL, '', NULL, NULL, NULL), (11, '家电等', NULL, 'clothing_others', 2, NULL, '', NULL, NULL, NULL), (12, '铁', NULL, 'metal', 3, NULL, '', NULL, NULL, NULL), (13, '铜', NULL, 'metal', 3, NULL, '', NULL, NULL, NULL), (14, '铝等', NULL, 'metal', 3, NULL, '', NULL, NULL, NULL), (15, '各类塑料制品', NULL, 'plastic', 4, NULL, '', NULL, NULL, NULL);
COMMIT;

-- ----------------------------
-- Table structure for fa_gdshop_guarantee
-- ----------------------------
DROP TABLE IF EXISTS `fa_gdshop_guarantee`;
CREATE TABLE `fa_gdshop_guarantee`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  `guarantee_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '保证类型',
  `createtime` bigint(20) NULL DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '售卖保证表';

-- ----------------------------
-- Records of fa_gdshop_guarantee
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for fa_gdshop_notice
-- ----------------------------
DROP TABLE IF EXISTS `fa_gdshop_notice`;
CREATE TABLE `fa_gdshop_notice`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID编号',
  `content` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '公告内容',
  `target_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '公告详情URL',
  `weigh` int(11) NULL DEFAULT 0 COMMENT '权重',
  `createtime` bigint(20) NULL DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '公告表';

-- ----------------------------
-- Records of fa_gdshop_notice
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for fa_gdshop_product
-- ----------------------------
DROP TABLE IF EXISTS `fa_gdshop_product`;
CREATE TABLE `fa_gdshop_product`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '商品名称',
  `category_id` int(10) UNSIGNED NOT NULL COMMENT '品类 id，关联分类表',
  `price` decimal(10, 2) NOT NULL COMMENT '价格',
  `list_price` decimal(10, 2) NOT NULL COMMENT '吊牌价',
  `tags` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '商品 tag，如：新品等',
  `header_images` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '轮播头图',
  `sales_volume_monthly` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '月销量',
  `location` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '店铺所在地',
  `store_id` int(10) UNSIGNED NOT NULL COMMENT '店铺 id',
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '商品图文描述',
  `status` tinyint(1) NOT NULL COMMENT '状态:0-下架；1-上架',
  `createtime` bigint(20) NULL DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(20) NULL DEFAULT NULL COMMENT '更新时间',
  `deletetime` bigint(20) NULL DEFAULT NULL COMMENT '删除时间',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `store_id`(`store_id`) USING BTREE,
  CONSTRAINT `fa_gdshop_product_ibfk_1` FOREIGN KEY (`store_id`) REFERENCES `fa_gdshop_store` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '商品表';

-- ----------------------------
-- Records of fa_gdshop_product
-- ----------------------------
BEGIN;
INSERT INTO `fa_gdshop_product` (`id`, `name`, `category_id`, `price`, `list_price`, `tags`, `header_images`, `sales_volume_monthly`, `location`, `store_id`, `description`, `status`, `createtime`, `updatetime`, `deletetime`) VALUES (1, '智能手机', 1, 2999.99, 3499.99, '新品', NULL, '100', '北京市朝阳区某商场', 1, '一款高性能智能手机，拥有强大的处理器和高清屏幕。', 1, NULL, NULL, NULL), (2, '笔记本电脑', 2, 4999.99, 5499.99, '热门', NULL, '80', '上海市浦东新区某电脑城', 2, '轻薄便携的笔记本电脑，适合办公和娱乐。', 1, NULL, NULL, NULL), (3, '运动鞋', 3, 399.99, 499.99, '畅销', NULL, '120', '广州市天河区某商业街', 3, '舒适的运动鞋，适合运动和日常穿着。', 1, NULL, NULL, NULL), (4, '连衣裙', 4, 199.99, 249.99, '时尚', NULL, '150', '深圳市福田区某购物中心', 4, '漂亮的连衣裙，适合各种场合。', 1, NULL, NULL, NULL), (5, '智能手表', 5, 999.99, 1199.99, '新品', NULL, '60', '杭州市西湖区某数码广场', 5, '功能强大的智能手表，具备多种健康监测功能。', 1, NULL, NULL, NULL);
COMMIT;

-- ----------------------------
-- Table structure for fa_gdshop_product_attribute
-- ----------------------------
DROP TABLE IF EXISTS `fa_gdshop_product_attribute`;
CREATE TABLE `fa_gdshop_product_attribute`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  `attribute_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '属性名称，如颜色、尺码',
  `createtime` bigint(20) NULL DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(20) NULL DEFAULT NULL COMMENT '修改时间',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `attribute_name`(`attribute_name`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 13 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '属性表';

-- ----------------------------
-- Records of fa_gdshop_product_attribute
-- ----------------------------
BEGIN;
INSERT INTO `fa_gdshop_product_attribute` (`id`, `attribute_name`, `createtime`, `updatetime`) VALUES (1, '颜色', NULL, NULL), (2, '内存', NULL, NULL), (3, '屏幕尺寸', NULL, NULL), (4, '摄像头', NULL, NULL), (5, '尺码', NULL, NULL), (6, '产地', NULL, NULL);
COMMIT;

-- ----------------------------
-- Table structure for fa_gdshop_product_coupon
-- ----------------------------
DROP TABLE IF EXISTS `fa_gdshop_product_coupon`;
CREATE TABLE `fa_gdshop_product_coupon`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  `coupon_id` int(10) UNSIGNED NOT NULL COMMENT '优惠券 ID，关联优惠券表',
  `product_id` int(10) UNSIGNED NOT NULL COMMENT '商品 ID，关联商品表',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `idx_coupon_id_product_id`(`coupon_id`, `product_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 14 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '商品优惠券关联表';

-- ----------------------------
-- Records of fa_gdshop_product_coupon
-- ----------------------------
BEGIN;
INSERT INTO `fa_gdshop_product_coupon` (`id`, `coupon_id`, `product_id`) VALUES (10, 1, 10), (1, 2, 1), (6, 3, 6), (2, 4, 2), (11, 5, 1), (3, 5, 3), (7, 6, 7), (12, 7, 1), (4, 7, 4), (8, 8, 8), (13, 9, 1), (5, 9, 5), (9, 10, 9);
COMMIT;

-- ----------------------------
-- Table structure for fa_gdshop_product_guarantee
-- ----------------------------
DROP TABLE IF EXISTS `fa_gdshop_product_guarantee`;
CREATE TABLE `fa_gdshop_product_guarantee`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  `product_id` int(10) UNSIGNED NOT NULL COMMENT '商品表 ID',
  `guarantee_id` int(10) UNSIGNED NOT NULL COMMENT '售卖保证表 ID',
  `createtime` bigint(20) NULL DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '售卖保证关联表';

-- ----------------------------
-- Records of fa_gdshop_product_guarantee
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for fa_gdshop_product_promotion
-- ----------------------------
DROP TABLE IF EXISTS `fa_gdshop_product_promotion`;
CREATE TABLE `fa_gdshop_product_promotion`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  `product_id` int(10) UNSIGNED NOT NULL COMMENT '商品表 ID',
  `promotion_id` int(10) UNSIGNED NOT NULL COMMENT '促销活动表 ID',
  `createtime` bigint(20) NULL DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 16 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '商品促销活动表关联表';

-- ----------------------------
-- Records of fa_gdshop_product_promotion
-- ----------------------------
BEGIN;
INSERT INTO `fa_gdshop_product_promotion` (`id`, `product_id`, `promotion_id`, `createtime`) VALUES (1, 1, 1, NULL), (2, 1, 2, NULL), (3, 2, 1, NULL), (4, 2, 2, NULL), (5, 3, 2, NULL), (6, 3, 1, NULL), (7, 4, 1, NULL), (8, 4, 2, NULL), (9, 5, 1, NULL), (10, 5, 2, NULL);
COMMIT;

-- ----------------------------
-- Table structure for fa_gdshop_product_sale_tips
-- ----------------------------
DROP TABLE IF EXISTS `fa_gdshop_product_sale_tips`;
CREATE TABLE `fa_gdshop_product_sale_tips`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '关联 ID，主键，自增',
  `product_id` int(10) UNSIGNED NOT NULL COMMENT '商品 ID，关联商品表',
  `tips` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '推广信息',
  `is_actived` tinyint(1) NULL DEFAULT 1 COMMENT '是否激活（0-不激活，1-激活）默认1',
  `createtime` bigint(20) NULL DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(20) NULL DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '商品推广信息表';

-- ----------------------------
-- Records of fa_gdshop_product_sale_tips
-- ----------------------------
BEGIN;
INSERT INTO `fa_gdshop_product_sale_tips` (`id`, `product_id`, `tips`, `is_actived`, `createtime`, `updatetime`) VALUES (1, 1, '限时优惠，快来抢购！', 1, NULL, NULL), (2, 2, '新品上市，享受首发折扣！', 1, NULL, NULL), (3, 3, '会员专享，积分兑换好礼！', 1, NULL, NULL), (4, 4, '节日特惠，全场满减！', 0, NULL, NULL), (5, 5, '满额赠礼，惊喜连连！', 1, NULL, NULL);
COMMIT;

-- ----------------------------
-- Table structure for fa_gdshop_product_shipping_fee_spec
-- ----------------------------
DROP TABLE IF EXISTS `fa_gdshop_product_shipping_fee_spec`;
CREATE TABLE `fa_gdshop_product_shipping_fee_spec`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '关联 ID，主键，自增',
  `shipping_fee_spec_id` int(10) UNSIGNED NOT NULL COMMENT '运费ID，关联运费表',
  `product_id` int(10) UNSIGNED NOT NULL COMMENT '商品 ID，关联商品表',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '运费规则关联表';

-- ----------------------------
-- Records of fa_gdshop_product_shipping_fee_spec
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for fa_gdshop_product_sku
-- ----------------------------
DROP TABLE IF EXISTS `fa_gdshop_product_sku`;
CREATE TABLE `fa_gdshop_product_sku`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'SKU 的唯一标识，自增整数',
  `product_id` int(10) UNSIGNED NULL DEFAULT NULL COMMENT '关联的商品 ID',
  `sku_code` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'SKU 编码，唯一',
  `stock` int(11) NULL DEFAULT 0 COMMENT '库存数量',
  `price` decimal(10, 2) NOT NULL COMMENT '价格',
  `createtime` bigint(20) NULL DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(20) NULL DEFAULT NULL COMMENT '修改时间',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `sku_code`(`sku_code`) USING BTREE,
  INDEX `product_id`(`product_id`) USING BTREE,
  CONSTRAINT `fa_gdshop_product_sku_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `fa_gdshop_product` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 22 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = 'SKU表';

-- ----------------------------
-- Records of fa_gdshop_product_sku
-- ----------------------------
BEGIN;
INSERT INTO `fa_gdshop_product_sku` (`id`, `product_id`, `sku_code`, `stock`, `price`, `createtime`, `updatetime`) VALUES (1, 1, 'SKU-A-RED', 50, 4999.00, NULL, NULL), (2, 1, 'SKU-A-BLACK', 30, 4999.00, NULL, NULL), (3, 2, 'SKU-B-WHITE', 100, 2999.00, NULL, NULL), (4, 3, 'SKU-C-GREEN', 20, 6999.00, NULL, NULL), (5, 3, 'SKU-C-BLUE', 10, 6999.00, NULL, NULL), (6, 4, 'SKU-fish-A', 100, 400.00, NULL, NULL), (7, 4, 'SKU-fish-B', 50, 200.00, NULL, NULL);
COMMIT;

-- ----------------------------
-- Table structure for fa_gdshop_product_sku_attribute
-- ----------------------------
DROP TABLE IF EXISTS `fa_gdshop_product_sku_attribute`;
CREATE TABLE `fa_gdshop_product_sku_attribute`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  `sku_id` int(10) UNSIGNED NULL DEFAULT NULL COMMENT '产品 SKU 的 ID',
  `attribute_id` int(10) UNSIGNED NULL DEFAULT NULL COMMENT '属性的 ID',
  `attribute_value` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '属性值',
  `createtime` bigint(20) NULL DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(20) NULL DEFAULT NULL COMMENT '修改时间',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `idx_sku_id_attribute_id`(`sku_id`, `attribute_id`) USING BTREE,
  INDEX `attribute_id`(`attribute_id`) USING BTREE,
  CONSTRAINT `fa_gdshop_product_sku_attribute_ibfk_1` FOREIGN KEY (`sku_id`) REFERENCES `fa_gdshop_product_sku` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT,
  CONSTRAINT `fa_gdshop_product_sku_attribute_ibfk_2` FOREIGN KEY (`attribute_id`) REFERENCES `fa_gdshop_product_attribute` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 20 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'SKU属性值表';

-- ----------------------------
-- Records of fa_gdshop_product_sku_attribute
-- ----------------------------
BEGIN;
INSERT INTO `fa_gdshop_product_sku_attribute` (`id`, `sku_id`, `attribute_id`, `attribute_value`, `createtime`, `updatetime`) VALUES (1, 6, 6, '挪威', NULL, NULL), (2, 7, 6, '国内', NULL, NULL), (5, 1, 1, '红色', NULL, NULL), (6, 1, 2, '128G', NULL, NULL), (7, 1, 3, '6.1寸', NULL, NULL), (8, 2, 1, '黑色', NULL, NULL), (9, 2, 2, '256G', NULL, NULL), (10, 2, 3, '6.1寸', NULL, NULL), (11, 3, 1, '白色', NULL, NULL), (12, 3, 2, '64G', NULL, NULL), (13, 3, 3, '6.5寸', NULL, NULL), (14, 4, 1, '绿色', NULL, NULL), (15, 4, 2, '128G', NULL, NULL), (16, 4, 3, '6.7寸', NULL, NULL), (17, 5, 1, '蓝色', NULL, NULL), (18, 5, 2, '256G', NULL, NULL), (19, 5, 3, '6.7寸', NULL, NULL);
COMMIT;

-- ----------------------------
-- Table structure for fa_gdshop_promotion
-- ----------------------------
DROP TABLE IF EXISTS `fa_gdshop_promotion`;
CREATE TABLE `fa_gdshop_promotion`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  `promotion_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '活动类型',
  `rule_description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '规则描述',
  `threshold` int(11) NOT NULL COMMENT '阈值',
  `sort_rule` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '排序规则',
  `reduction_number` int(11) NOT NULL COMMENT '减免数量',
  `reduction_rule` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '减免规则',
  `reduction_discount` int(11) NOT NULL COMMENT '减免折扣',
  `start_date` bigint(20) NOT NULL COMMENT '生效日期',
  `end_date` bigint(20) NOT NULL COMMENT '失效日期',
  `category_ids` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '品类 ids',
  `createtime` bigint(20) NULL DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(20) NULL DEFAULT NULL COMMENT '修改时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '促销活动表';

-- ----------------------------
-- Records of fa_gdshop_promotion
-- ----------------------------
BEGIN;
INSERT INTO `fa_gdshop_promotion` (`id`, `promotion_type`, `rule_description`, `threshold`, `sort_rule`, `reduction_number`, `reduction_rule`, `reduction_discount`, `start_date`, `end_date`, `category_ids`, `createtime`, `updatetime`) VALUES (1, '多买优惠', '满2件立减最低1件商品价格', 2, 'DESC', 1, '指定数量', 0, 1730131200, 1730131200, '1,2,3', 1730131200, 1730131200), (2, '多买折扣', '满4件打7折', 4, '', 0, '所有', 70, 1730131200, 1730131200, '4,5', 1730131200, 1730131200);
COMMIT;

-- ----------------------------
-- Table structure for fa_gdshop_shipping_fee_spec
-- ----------------------------
DROP TABLE IF EXISTS `fa_gdshop_shipping_fee_spec`;
CREATE TABLE `fa_gdshop_shipping_fee_spec`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '关联 ID，主键，自增',
  `store_id` int(10) UNSIGNED NOT NULL COMMENT '店铺 ID，关联店铺表',
  `memo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '运费描述',
  `city_ids` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '适用地区（城市为准）',
  `price` decimal(10, 2) NOT NULL COMMENT '运费',
  `allow_shipping` tinyint(1) NULL DEFAULT 1 COMMENT '允许发货（0-不发货，1-发货）',
  `create_by` int(10) UNSIGNED NOT NULL COMMENT '创建人',
  `update_by` int(10) UNSIGNED NOT NULL COMMENT '更新人',
  `createtime` bigint(20) NULL DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(20) NULL DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '运费表';

-- ----------------------------
-- Records of fa_gdshop_shipping_fee_spec
-- ----------------------------
BEGIN;
INSERT INTO `fa_gdshop_shipping_fee_spec` (`id`, `store_id`, `memo`, `city_ids`, `price`, `allow_shipping`, `create_by`, `update_by`, `createtime`, `updatetime`) VALUES (1, 1, '江浙沪10元', '802,821,833,842,853,861,871,880,887,896,906,913,920,927,934,948,960,972,980,986,993,1003,1010,1015,1025,1035', 10.00, 1, 1, 1, 1729842029000, 1729842029000), (2, 1, '福建地区包邮', '1169,1183,1190,1196,1209,1222,1234,1245,1253', 0.00, 1, 2, 2, 1729842029000, 1729842029000), (3, 3, '加急运费 - 店铺3', 'ALL', 20.00, 1, 3, 3, 1729842029000, 1729842029000), (4, 4, '标准运费 - 店铺4（多个城市）', '6,7,8,9,10', 15.00, 1, 4, 4, 1729842029000, 1729842029000), (5, 5, '国际运费 - 店铺5', 'INTL', 50.00, 1, 5, 5, 1729842029000, 1729842029000);
COMMIT;

-- ----------------------------
-- Table structure for fa_gdshop_store
-- ----------------------------
DROP TABLE IF EXISTS `fa_gdshop_store`;
CREATE TABLE `fa_gdshop_store`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '关联 ID，主键，自增',
  `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '店铺名称',
  `biz_scope` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '运营范围',
  `user_id` int(10) UNSIGNED NOT NULL COMMENT '负责人ID',
  `province_id` int(10) UNSIGNED NOT NULL COMMENT '省ID',
  `city_id` int(10) UNSIGNED NOT NULL COMMENT '市ID',
  `area_id` int(10) UNSIGNED NOT NULL COMMENT '区县ID',
  `site` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '店铺详细地址',
  `location` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '店铺所在地',
  `license_no` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '营业执照号',
  `license_image` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '营业执照照片',
  `is_actived` tinyint(1) NULL DEFAULT 1 COMMENT '是否激活（0-不激活，1-激活）默认1',
  `createtime` bigint(20) NULL DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(20) NULL DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 21 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '店铺信息表';

-- ----------------------------
-- Records of fa_gdshop_store
-- ----------------------------
BEGIN;
INSERT INTO `fa_gdshop_store` (`id`, `name`, `biz_scope`, `user_id`, `province_id`, `city_id`, `area_id`, `site`, `location`, `license_no`, `license_image`, `is_actived`, `createtime`, `updatetime`) VALUES (1, '店铺名称1', '运营范围1', 1, 466, 508, 509, '详细地址1', '辽宁本溪', '营业执照号1', '营业执照照片1.jpg', 1, 1729753735, 1729753735), (2, '店铺名称2', '运营范围2', 2, 1709, 1740, 1745, '详细地址2', '湖北宜昌', '营业执照号2', '营业执照照片2.jpg', 1, 1729753735, 1729753735), (3, '店铺名称3', '运营范围3', 3, 1827, 1890, 1898, '详细地址3', '湖南常德', '营业执照号3', '营业执照照片3.jpg', 1, 1729753735, 1729753735), (4, '店铺名称4', '运营范围4', 4, 37, 84, 92, '详细地址4', '河北邯郸', '营业执照号4', '营业执照照片4.jpg', 1, 1729753735, 1729753735), (5, '店铺名称5', '运营范围5', 5, 2572, 2620, 2627, '详细地址5', '贵州铜仁', '营业执照号5', '营业执照照片5.jpg', 1, 1729753735, 1729753735), (6, '店铺名称6', '运营范围6', 6, 2162, 2264, 2265, '详细地址6', '广西河池', '营业执照号6', '营业执照照片6.jpg', 1, 1729753735, 1729753735), (7, '店铺名称7', '运营范围7', 7, 3022, 3081, 3089, '详细地址7', '甘肃庆阳', '营业执照号7', '营业执照照片7.jpg', 1, 1729753735, 1729753735), (8, '店铺名称8', '运营范围8', 8, 1375, 1421, 1430, '详细地址8', '山东烟台', '营业执照号8', '营业执照照片8.jpg', 1, 1729753735, 1729753735), (9, '店铺名称9', '运营范围9', 9, 3325, 3461, 3465, '详细地址9', '台湾新北', '营业执照号9', '营业执照照片9.jpg', 1, 1729753735, 1729753735), (10, '店铺名称10', '运营范围10', 10, 1827, 1848, 1853, '详细地址10', '湖南湘潭', '营业执照号10', '营业执照照片10.jpg', 1, 1729753735, 1729753735), (11, '店铺名称1', '运营范围1', 1, 2367, 2409, 2412, '详细地址1', '四川德阳', '营业执照号1', '营业执照照片1.jpg', 1, 1729841982, 1729841982), (12, '店铺名称2', '运营范围2', 2, 2367, 2554, 2557, '详细地址2', '四川凉山', '营业执照号2', '营业执照照片2.jpg', 1, 1729841982, 1729841982), (13, '店铺名称3', '运营范围3', 3, 220, 264, 268, '详细地址3', '山西晋城', '营业执照号3', '营业执照照片3.jpg', 1, 1729841982, 1729841982), (14, '店铺名称4', '运营范围4', 4, 933, 1010, 1014, '详细地址4', '浙江舟山', '营业执照号4', '营业执照照片4.jpg', 1, 1729841982, 1729841982), (15, '店铺名称5', '运营范围5', 5, 1532, 1623, 1624, '详细地址5', '河南濮阳', '营业执照号5', '营业执照照片5.jpg', 1, 1729841982, 1729841982), (16, '店铺名称6', '运营范围6', 6, 2898, 2913, 2917, '详细地址6', '陕西铜川', '营业执照号6', '营业执照照片6.jpg', 1, 1729841982, 1729841982), (17, '店铺名称7', '运营范围7', 7, 466, 522, 525, '详细地址7', '辽宁锦州', '营业执照号7', '营业执照照片7.jpg', 1, 1729841982, 1729841982), (18, '店铺名称8', '运营范围8', 8, 1263, 1306, 1322, '详细地址8', '江西赣州', '营业执照号8', '营业执照照片8.jpg', 1, 1729841982, 1729841982), (19, '店铺名称9', '运营范围9', 9, 3325, 3339, 3358, '详细地址9', '台湾高雄', '营业执照号9', '营业执照照片9.jpg', 1, 1729841982, 1729841982), (20, '店铺名称10', '运营范围10', 10, 2162, 2207, 2209, '详细地址10', '广西梧州', '营业执照号10', '营业执照照片10.jpg', 1, 1729841982, 1729841982);
COMMIT;

-- ----------------------------
-- Table structure for fa_gdshop_user_coupon
-- ----------------------------
DROP TABLE IF EXISTS `fa_gdshop_user_coupon`;
CREATE TABLE `fa_gdshop_user_coupon`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  `user_id` int(10) UNSIGNED NOT NULL COMMENT '用户 ID，关联用户表',
  `coupon_id` int(10) UNSIGNED NOT NULL COMMENT '优惠券 ID，关联优惠券表',
  `is_used` tinyint(1) NOT NULL COMMENT '是否已使用，0 表示未使用，1 表示已使用，2 表示已过期',
  `used_date` bigint(20) NULL DEFAULT NULL COMMENT '使用日期，如果已使用则记录使用时间',
  `gift_by` int(10) UNSIGNED NULL DEFAULT NULL COMMENT '赠送人 ID',
  `get_time` bigint(20) NOT NULL COMMENT '领用时间',
  `createtime` bigint(20) NULL DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(20) NULL DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 11 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户优惠券关联表';

-- ----------------------------
-- Records of fa_gdshop_user_coupon
-- ----------------------------
BEGIN;
INSERT INTO `fa_gdshop_user_coupon` (`id`, `user_id`, `coupon_id`, `is_used`, `used_date`, `gift_by`, `get_time`, `createtime`, `updatetime`) VALUES (1, 1, 2, 0, NULL, NULL, 1730076103, NULL, NULL), (2, 2, 4, 0, NULL, NULL, 1730076103, NULL, NULL), (3, 3, 5, 0, NULL, NULL, 1730076103, NULL, NULL), (4, 1, 7, 1, 1730014507, NULL, 1730076103, NULL, NULL), (5, 2, 9, 0, NULL, NULL, 1730076103, NULL, NULL), (6, 3, 3, 0, NULL, NULL, 1730076103, NULL, NULL), (7, 4, 6, 0, NULL, NULL, 1730076103, NULL, NULL), (8, 5, 8, 0, NULL, NULL, 1730076103, NULL, NULL), (9, 1, 10, 0, NULL, NULL, 1730076103, NULL, NULL), (10, 2, 1, 2, 1730072503, NULL, 1729989703, NULL, NULL);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
